048 functions

您好,在这个视频中,我们将学习如何在 Teleporter 中创建一个函数,在一个新的块中,您将看到函数、工作和函数。
Hello, in this video, we are going to learn how to create a function in teleporter, in a new block, you will see function, work and function.

重要的是,第一个功能块需要数据块,但功能不需要数据。
And the important thing, first function block needs a data block, but functions are not needed data.

好吧,这真的很重要。
OK, this is really important.

而该函数的语言编程语言可以是Líder或Speedie或ACL out。
And the language programming language of this function can be Líder or Speedie or ACL out.

我将使用一个小图表,我会说,好的,这个函数是用名称“块一”创建的,我会说,例如,“电机”。
I will use a little diagram and I will say, OK, this function is created with the name Block one and I will say, for example, motor.

输出。
Output.

函数,好的,在这个函数里面,你会看到这个区域,可以是这样的。
Function, OK, inside of this function, you will see this area, it can be like this.

我会。
I will.

好吧,也许你看不到它,但是如果你来到这里屏蔽界面并离开,点击它,它将是对等的,并且将开始输入。
OK, maybe you can't see it, but if you come to here to block interface and left, click to it, it will be peer and input will be start.

好的,还有一件事,停止和输出将是电机前进。
OK, and one more thing, stop and output will be motor forward.

好吧,这些确实很重要。
OK, these are really important.

还有一件事来到这里。
And another thing come to here.

在这里,常闭触点,它将启动,第二个将停止,最后一个电机正转,OK,功能准备就绪。
And in here, normally close contact, it will be start, the second one will be stop and the last one motor forward, OK, dysfunction is ready.

那么我们如何在主轨道上使用它呢?
So how can we use it in main orbit?

我会举起它。
I will lift it.

而用拖放的方式,我就这样说。
And with the drag and drop method, I will put it like this.

好的,网络我可以一直使用。
OK, and the network to I can use it always.

我可以把这个功能。
I can put this function.

任何时候我们可以,比如说,我们可以使用它,或者如果你想使用它,比如说,20次,你可以使用它,好吧,这个函数将始终返回这个法庭或这个程序,好吗?
Any any time that we can, for example, we can use it, or if you want to use it, for example, 20 times, you can use it, OK, this function will return always this court or this program, OK?

我可能不会去那里。
And it may not be I will go there.

然后我会说零点零零点一和零点这是一回事,例如,M 2.0 和两点一和 M 两点二。
Then I will say zero point zero zero point one and zero point to this is one thing and for example, M 2.0 and two point one and M two point two.

好的,现在我们准备好了。
OK, now we are ready.

让我们去模拟器检查一次。
Let's go to our simulator and let's check once.

它是否正常工作,或者是否影响其功能?
Is it working correctly or not, or is it affecting this to function?

它是否会共同影响或者是否会导致输出损坏?
Is is it affecting together or is it causing any corruption for the output or not?

我们会看到。
We will see.

现在我们的模拟器正在运行,并且我们的模拟器处于现在启动和运行停止的状态。
Now our simulator is running and our simulator is in the now starting situation and running stop.

我们还需要再等一下。
And we need to wait a little bit more.

我们将在线访问这个 sepehr 和模拟器 Sepehr,我们将检查所有这些。
We will go online to this sepehr and simulator Sepehr, and we will check all of them.

现在正在编译。
Now it's compiling.

功能块和功能对于我们的编程非常重要,例如,我们可以为大脑运动控制创建一个功能,并且我们可以在例如有五个驱动器的情况下使用该功能,例如西蒙斯的驱动器,以及您可以只使用这五个功能中的一个功能来为交流和暂时写作。
Function blocks and also functions are really important for our programming, we can create a function for the cerebral motor control, for example, and we can use that one function in for example, you have five drive and for example, Simmons' drives, and you can just use one function for this five to write for the communication and for the moment.

好的。
Okay.

现在我们没事了。
And now we are OK.

现在我们可以上网了,我们可以监控了。
Now we can go online and we can monitoring.

但首先,我们需要检查。
But first of all, we need to check.

我们在线,一切顺利。
We are online and OK and OK.

一切都好。
Everything is OK.

那么现在我们能做什么呢。
So now what can we do.

例如,我们现在可以将其设置为 80%,并将零点零修改为一。
For example, we can make it maybe 80 percent now and zero point zero is modify to one.

所以我们有一个完整的输出,但另一个输出则不行。
So we have an output through and through but another output is not OK.

好的,所以如果我更新停止输入,则没有输出。
OK, so if I update stop input then there is no output.

这个函数也是一样的。
The same thing for this function.

我也会来到这里,彻底修改为一。
Also I will come to here and modify to one through and through.

这是正确的。
That's correct.

并停止落实到位和真假。
And stop putting in place and true and false.

这是正确的。
That's correct.

因此,我们可以创建这样的函数,一个新的块和函数,我们可以选择我们的编程语言,我们可以说“确定”,然后创建另一个函数,包括输入、输出、内部结构、时间和常数。
So we can create functions like this, a new block and function and we can select our programming language and we can say OK, and another function that is created and inputs and outputs and internals and times and constant.

这些与功能块非常非常相似。
These are really, really similar with the function blocks.

重要的是,如果我添加一个功能块,现在会发生什么?
And the important thing, if I add one function block, what will happen now?

您将看到功能块需要数据块。
You will see function block is needs a data block.

好的,如果我在没有编程的情况下进入Main或B,我将测试是否要添加此功能块。
OK, if I go to Main or B without programming, I will test wants to add this function block.

请注意,像这样。
Note um it like this.

好的,您将直接看到它正在从您的给定名称请求此数据块,并且此数据块将用于此块,此功能。
OK, you will see directly it is requesting from your given name to this data block and this data block is going to be used for this block, this function.

OK,这就是功能块和函数最大的区别了。
OK, this is the biggest difference between the function blocks and functions.

那么这就是我们如何创建一个函数,如何在程序中使用这些函数以及如何调整我们的输入和输出?
So this is how can we create a function and how can we use these functions in our programs and how can we adapt our inputs and outputs?

我已经完成了这个视频。
Am finished for this video.

下一个视频见。
See you in the next video.